﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CMSModel;

public partial class news_NewStockAdd : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        NewStock c = new NewStock();
        c.CapitalStock = txtCapitalStock.Text;
        c.DilutedEarnings = txtDilutedEarnings.Text;
        c.EarningsPerShare = txtEarningsPerShare.Text;
        c.ForecastPrice = txtForecastPrice.Text;
        c.Industry = txtIndustry.Text;
        c.InvestmentHighlights = txtInvestmentHighlights.Text;
        c.MunicipalGrowth = txtMunicipalGrowth.Text;
        c.N10E = txt10E.Text;
        c.N11E = txt11E.Text;
        c.N12E = txt12E.Text;
        c.Name = txtName.Text;
        c.NetAssetsPerShare = txtNetAssetsPerShare.Text;
        c.NetRateOf = txtNetRateOf.Text;
        c.YieldPrediction = txtYieldPrediction.Text;
        if (RadioButtonList1.SelectedValue == "1")
        {
            c.IsEnable = true;
        }
        else
        {
            c.IsEnable = false;
        }
        CMSModel.CMSEntities dal = DAL.DBManager.GetCmsEmtity();
        dal.NewStock.AddObject(c);
        dal.SaveChanges();
        ClientScript.RegisterStartupScript(GetType(), "aa", "alert('添成功');document.location='NewStock.aspx'", true);
    }
}